package com.test.collec;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public class MapDemo {
    public static void main(String[] args) {
      //  Map map = new HashMap();
       // Map map = Collections.synchronizedMap(new HashMap<>());
        Map map = new ConcurrentHashMap();
        for (int i = 0; i < 100; i++) {
            new Thread(()->{
                map.put(Thread.currentThread().getName(),UUID.randomUUID().toString().substring(1,8));
                System.out.println(map.keySet());
            },String.valueOf(i)).start();
        }
    }
}
